package com.lipaluma.example.clients.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.lipaluma.example.clients.model.Order;

public interface IOrderDAO extends JpaRepository<Order, Long> {

	@Query("select object(o) from Order o where o.status = 'CREATED' and o.account.id = :account")
	List<Order> getLastOrdersCreatedForAccount(@Param("account")Long idAccount);

}
